<template>
    <div>
      <ul class="todo-main">
        <slot name="list"></slot>
        <todo-item v-for="item in list" :key="item.id" :item="item">
          <template #default="{text}">
            <slot name="item" :text="text"></slot>
          </template>
        </todo-item>
      </ul>
    </div>
</template>

<script>
    import item from "./todo-item"
    export default {
        name: "todo-list",
        props:["list"],
        components:{
          "todo-item":item
        }
    }
</script>

<style scoped>
  /*main*/
  .todo-main {
    margin-left: 0px;
    border: 1px solid #ddd;
    border-radius: 2px;
    padding: 0px;
  }

  .todo-empty {
    height: 40px;
    line-height: 40px;
    border: 1px solid #ddd;
    border-radius: 2px;
    padding-left: 5px;
    margin-top: 10px;
  }
</style>
